//
//  UIImage+FQDExtension.m
//  FakeQDaily
//
//  Created by mewxiv on 9/13/16.
//  Copyright © 2016 Xensius. All rights reserved.
//

#import "UIImage+FQDExtension.h"

@implementation UIImage (FQDExtension)

- (UIImage *)roundImage
{
    UIGraphicsBeginImageContext(self.size);
    CGContextRef context = UIGraphicsGetCurrentContext();
    CGRect rect = CGRectMake(0, 0, self.size.width, self.size.height);
    CGContextAddEllipseInRect(context, rect);
    CGContextClip(context);
    [self drawInRect:rect];
    UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    return image;
}

@end
